/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wx
 * Date: 2023-08-02
 * Time: 18:34
 */
class Student {
    public String name ;
    public int age ;
    //没有返回值 方法名和类名一样
    //可以对成员初始化
    public Student() {
        this.name="张三";
        this.age = 10;
        System.out.println("Student()");
    }
    public Student(String name, int age) {
        this.name = name;
        this.age  = age;
        System.out.println("Student(String,int)");
    }

    public void show (){
        System.out.println(this.name+" "+this.age);
    }
}
public class Test {
    public static void main(String[] args) {
        //1
        Student student = new Student();
        Student student1 = new Student("san",18);
        student.show();
        /*student.name = "张三";
        student.age = 18;
        student.show();

        System.out.println("===========");

        student.name = "李四";
        student.age = 18;
        student.show();

        int a;
        System.out.println(a);*/

    }
}
